<?php
	include "../../public/commom/config.php";
	include "../lock1.php";		
?>

<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="utf-8" />
		<title></title>
		<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="../public/css/index.css"/>
	</head>
	
	<body>
		<div id="main">
			<h1>订单号信息</h1>
			<table class="table table-bordered">
				<thead>
					<tr><th>编号</th><th>订单号</th><th>商品</th><th>图片</th><th>数量</th><th>共计</th></tr>
				</thead>
				<tbody>
				<?php
					if($_GET) {
						$code = $_GET["code"];
						
						$sql = "SELECT indent.*, shop.name sname, shop.img iname FROM indent LEFT JOIN shop ON (indent.shop_id = shop.id) WHERE code = '$code'";
						
						$result = mysqli_query($conn, $sql);
						
						while($row = mysqli_fetch_array($result)) {
							echo "<tr>
									<td>" . $row["id"] . "</td>
									<td>" . $row["code"] . "</td>
									<td>" . $row["sname"] . "</td>
									<td><img src='../public/uploads/thumb_" . $row["iname"] . "' width=40px/></td>
									<td>" . $row["num"] . "</td>
									<td>" . $row["price"] . "</td>
								</tr>";
						}
						
						mysqli_close($conn);
					}
					
				?>
				</tbody>
			</table>
		</div>
	</body>
	
</html>